home *** CD-ROM | disk | FTP | other *** search
- on setHandCursor spriteList
- set hand1 to the number of cast "HandCursorA"
- set hand2 to the number of cast "HandCursorB"
- set handCursor to [hand1, hand2]
- repeat with i = 1 to count(spriteList)
- set the cursor of sprite getAt(spriteList, i) to handCursor
- end repeat
- end
-
- on resetSpriteCursor first, last
- repeat with i = first to last
- set the cursor of sprite i to -1
- end repeat
- end
-
- on buttonClicked buttonList, buttonSymbol, finalPuppetState
- set spriteNum to getaProp(buttonList, buttonSymbol)
- if the clickOn <> spriteNum then
- return 0
- else
- set castUp to string(buttonSymbol) & "_B1"
- set castDown to string(buttonSymbol) & "_B2"
- puppetSprite(spriteNum, 1)
- set the castNum of sprite spriteNum to the number of cast castDown
- updateStage()
- set rolledOver to 1
- repeat while the stillDown
- if rollOver(spriteNum) and (rolledOver = 0) and the stillDown then
- set the castNum of sprite spriteNum to the number of cast castDown
- set rolledOver to 1
- updateStage()
- end if
- if (rollOver(spriteNum) = 0) and (rolledOver = 1) then
- set the castNum of sprite spriteNum to the number of cast castUp
- set rolledOver to 0
- updateStage()
- end if
- end repeat
- if rolledOver then
- makeButtonClickSound()
- end if
- set the castNum of sprite spriteNum to the number of cast castUp
- updateStage()
- if voidp(finalPuppetState) then
- puppetSprite(spriteNum, 0)
- else
- puppetSprite(spriteNum, finalPuppetState)
- end if
- return rolledOver
- end if
- end
-
- on buttonPushed buttonList, buttonSymbol
- global gButtonClickSound
- set spriteNum to getaProp(buttonList, buttonSymbol)
- if the clickOn <> spriteNum then
- return 0
- else
- set castUp to string(buttonSymbol) & "_B1"
- set castDown to string(buttonSymbol) & "_B2"
- puppetSprite(spriteNum, 1)
- set the castNum of sprite spriteNum to the number of cast castDown
- updateStage()
- set rolledOver to 1
- repeat while the stillDown
- if rollOver(spriteNum) and (rolledOver = 0) and the stillDown then
- set the castNum of sprite spriteNum to the number of cast castDown
- set rolledOver to 1
- updateStage()
- end if
- if (rollOver(spriteNum) = 0) and (rolledOver = 1) and the stillDown then
- set the castNum of sprite spriteNum to the number of cast castUp
- set rolledOver to 0
- updateStage()
- end if
- end repeat
- if rolledOver then
- makeButtonClickSound()
- end if
- puppetSprite(spriteNum, 0)
- updateStage()
- return rolledOver
- end if
- end
-
- on checkBoxClick currentState, spriteNum, castZero, castOne, puppetState
- puppetSprite(spriteNum, 1)
- set newState to not currentState
- if currentState = 0 then
- set overCast to the number of cast castOne
- set notOverCast to the number of cast castZero
- else
- set overCast to the number of cast castZero
- set notOverCast to the number of cast castOne
- end if
- set the castNum of sprite spriteNum to overCast
- updateStage()
- set rolledOver to 1
- repeat while the stillDown
- if rollOver(spriteNum) and (rolledOver = 0) and the stillDown then
- set the castNum of sprite spriteNum to overCast
- set rolledOver to 1
- set newState to not currentState
- updateStage()
- end if
- if (rollOver(spriteNum) = 0) and (rolledOver = 1) and the stillDown then
- set the castNum of sprite spriteNum to notOverCast
- set rolledOver to 0
- set newState to currentState
- updateStage()
- end if
- end repeat
- if puppetState = 0 then
- puppetSprite(spriteNum, 0)
- end if
- return newState
- end
-
- on rollOverHilite buttonList, buttonSymbol
- set spriteNum to getaProp(buttonList, buttonSymbol)
- if rollOver(spriteNum) then
- set castDown to string(buttonSymbol) & "_B2"
- puppetSprite(spriteNum, 1)
- set the castNum of sprite spriteNum to the number of cast castDown
- updateStage()
- return 1
- else
- set castUp to string(buttonSymbol) & "_B1"
- puppetSprite(spriteNum, 1)
- set the castNum of sprite spriteNum to the number of cast castUp
- updateStage()
- return 0
- end if
- end
-